package com.zr;

import com.zr.feignclient.FeignClientProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by Lx on 2018/9/11.
 */
@RestController
@Configuration
//@RibbonClient(name="hello")
public class Test {

    @Autowired
    private FeignClientProxy feignClientProxy;
    @GetMapping("feignTest")
    public String test(){
        return feignClientProxy.test();
    }

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/restTemplateTest")
    public String restTemplate(){
        String forObject = restTemplate.getForObject("http://CLOUDMATEDATA/proxyTest",String.class);
        return forObject;
    }
}
